package com.aode.login.viewmodel;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.MutableLiveData;

import com.aode.common.bean.request.LoginData;
import com.aode.common.bean.response.User;
import com.aode.common.bean.web.Result;
import com.aode.login.repository.Repository;

public class LoginViewModel extends AndroidViewModel {
    private Repository repository;
    public LoginViewModel(@NonNull Application application) {
        super(application);
        repository = new Repository(application);
    }

    public void login(LoginData loginData){
        repository.login(loginData);
    }
    public MutableLiveData<Result<User>> getLogin(){
        return repository.getLogin();
    }
}
